Optimal. Leaf size=202 \[ \frac {8 (9 B-19 C) \tan (c+d x)}{15 a^3 d}-\frac {(6 B-13 C) \tanh ^{-1}(\sin (c+d x))}{2 a^3 d}+\frac {4 (9 B-19 C) \tan (c+d x) \sec ^2(c+d x)}{15 d \left (a^3 \sec (c+d x)+a^3\right )}-\frac {(6 B-13 C) \tan (c+d x) \sec (c+d x)}{2 a^3 d}+\frac {(B-C) \tan (c+d x) \sec ^4(c+d x)}{5 d (a \sec (c+d x)+a)^3}+\frac {(6 B-11 C) \tan (c+d x) \sec ^3(c+d x)}{15 a d (a \sec (c+d x)+a)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.55, antiderivative size = 202, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.175, Rules used = {4072, 4019, 3787, 3767, 8, 3768, 3770} \[ \frac {8 (9 B-19 C) \tan (c+d x)}{15 a^3 d}-\frac {(6 B-13 C) \tanh ^{-1}(\sin (c+d x))}{2 a^3 d}+\frac {4 (9 B-19 C) \tan (c+d x) \sec ^2(c+d x)}{15 d \left (a^3 \sec (c+d x)+a^3\right )}-\frac {(6 B-13 C) \tan (c+d x) \sec (c+d x)}{2 a^3 d}+\frac {(B-C) \tan (c+d x) \sec ^4(c+d x)}{5 d (a \sec (c+d x)+a)^3}+\frac {(6 B-11 C) \tan (c+d x) \sec ^3(c+d x)}{15 a d (a \sec (c+d x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3768
Rule 3770
Rule 3787
Rule 4019
Rule 4072
Rubi steps
\begin {align*} \int \frac {\sec ^4(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{(a+a \sec (c+d x))^3} \, dx &=\int \frac {\sec ^5(c+d x) (B+C \sec (c+d x))}{(a+a \sec (c+d x))^3} \, dx\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {\int \frac {\sec ^4(c+d x) (4 a (B-C)-a (2 B-7 C) \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx}{5 a^2}\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {\int \frac {\sec ^3(c+d x) \left (3 a^2 (6 B-11 C)-a^2 (18 B-43 C) \sec (c+d x)\right )}{a+a \sec (c+d x)} \, dx}{15 a^4}\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}+\frac {\int \sec ^2(c+d x) \left (8 a^3 (9 B-19 C)-15 a^3 (6 B-13 C) \sec (c+d x)\right ) \, dx}{15 a^6}\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}+\frac {(8 (9 B-19 C)) \int \sec ^2(c+d x) \, dx}{15 a^3}-\frac {(6 B-13 C) \int \sec ^3(c+d x) \, dx}{a^3}\\ &=-\frac {(6 B-13 C) \sec (c+d x) \tan (c+d x)}{2 a^3 d}+\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}-\frac {(6 B-13 C) \int \sec (c+d x) \, dx}{2 a^3}-\frac {(8 (9 B-19 C)) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{15 a^3 d}\\ &=-\frac {(6 B-13 C) \tanh ^{-1}(\sin (c+d x))}{2 a^3 d}+\frac {8 (9 B-19 C) \tan (c+d x)}{15 a^3 d}-\frac {(6 B-13 C) \sec (c+d x) \tan (c+d x)}{2 a^3 d}+\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 2.12, size = 428, normalized size = 2.12 \[ \frac {\cos ^4\left (\frac {1}{2} (c+d x)\right ) \sec ^2(c+d x) \left (-64 (9 B-19 C) \tan ^3\left (\frac {1}{2} (c+d x)\right )+4 (87 B-197 C) \tan \left (\frac {1}{2} (c+d x)\right )+16 (12 B+13 C) \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)+\tan ^5\left (\frac {1}{2} (c+d x)\right ) \left (3 (B-C) \sec ^4\left (\frac {1}{2} (c+d x)\right )+228 B-428 C\right )+30 (6 B-13 C) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )-\tan ^3\left (\frac {1}{2} (c+d x)\right ) \sec ^4\left (\frac {1}{2} (c+d x)\right ) ((12 B-17 C) \cos (c+d x)-6 B+11 C)+\tan \left (\frac {1}{2} (c+d x)\right ) \sec ^4\left (\frac {1}{2} (c+d x)\right ) ((24 B-34 C) \cos (c+d x)-21 B+31 C)+30 (6 B-13 C) \tan ^4\left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )-60 (6 B-13 C) \tan ^2\left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )\right )}{60 a^3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 295, normalized size = 1.46 \[ -\frac {15 \, {\left ({\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{5} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left ({\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{5} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (16 \, {\left (9 \, B - 19 \, C\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (114 \, B - 239 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (234 \, B - 479 \, C\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (2 \, B - 3 \, C\right )} \cos \left (d x + c\right ) + 15 \, C\right )} \sin \left (d x + c\right )}{60 \, {\left (a^{3} d \cos \left (d x + c\right )^{5} + 3 \, a^{3} d \cos \left (d x + c\right )^{4} + 3 \, a^{3} d \cos \left (d x + c\right )^{3} + a^{3} d \cos \left (d x + c\right )^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.70, size = 233, normalized size = 1.15 \[ -\frac {\frac {30 \, {\left (6 \, B - 13 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{3}} - \frac {30 \, {\left (6 \, B - 13 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{3}} + \frac {60 \, {\left (2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 7 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a^{3}} - \frac {3 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 30 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, C a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 255 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 465 \, C a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{15}}}{60 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.78, size = 334, normalized size = 1.65 \[ \frac {B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d \,a^{3}}-\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{20 d \,a^{3}}+\frac {B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{3}}-\frac {2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3 d \,a^{3}}+\frac {17 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d \,a^{3}}-\frac {31 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d \,a^{3}}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) B}{d \,a^{3}}-\frac {13 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) C}{2 d \,a^{3}}+\frac {7 C}{2 d \,a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {B}{d \,a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {C}{2 d \,a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {7 C}{2 d \,a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {B}{d \,a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) B}{d \,a^{3}}+\frac {13 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) C}{2 d \,a^{3}}-\frac {C}{2 d \,a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 377, normalized size = 1.87 \[ -\frac {C {\left (\frac {60 \, {\left (\frac {5 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {7 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{3} - \frac {2 \, a^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\frac {465 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {40 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{3}} - \frac {390 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{3}} + \frac {390 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{3}}\right )} - 3 \, B {\left (\frac {40 \, \sin \left (d x + c\right )}{{\left (a^{3} - \frac {a^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} + \frac {\frac {85 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {\sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{3}} - \frac {60 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{3}} + \frac {60 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{3}}\right )}}{60 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.84, size = 216, normalized size = 1.07 \[ \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,\left (B-C\right )}{2\,a^3}+\frac {3\,\left (3\,B-5\,C\right )}{4\,a^3}+\frac {2\,B-10\,C}{4\,a^3}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,B-7\,C\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,B-5\,C\right )}{d\,\left (a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^3\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {B-C}{4\,a^3}+\frac {3\,B-5\,C}{12\,a^3}\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (B-C\right )}{20\,a^3\,d}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (6\,B-13\,C\right )}{a^3\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {B \sec ^{5}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{6}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx}{a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________